import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Creater with IntelliJ IDEA.
 * Description:
 * User: 86152
 * Dae: 2022-07-30
 * Time: 23:40
 */
public class demo4 {
    public static void main(String[] args) {
        ExecutorService pool= Executors.newFixedThreadPool(10);
                //newFixedThreadPool: 创建固定线程数的线程池
        //newCachedThreadPool: 创建线程数目动态增长的线程池.
        for(int i=0;i<10;i++) {
            pool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("sb");
                }
            });
        }
    }
}
